<!DOCTYPE html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{baseui/head :: head}">
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="description" content="动检通智慧云平台"/>
    <meta name="author" content="牧中(上海)物联网科技有限公司"/>
    <link rel="shortcut icon" href="/webjars/images/favicon.png"/>

    <title>牧中畜牧业大数据智慧云平台V1.0</title>


</head>
<body>
<!--顶部一级导航-->
<th:block th:replace="baseui/topheader :: topheader(1)"/>

<!--动检通菜单-->
<div id="topnav" th:replace="djt/partial/topnav :: topnav(3)"></div>
<div id="cl-wrapper">
    <!--左边导航-->
    <th:block th:replace="djt/partial/quarantine_left :: nav(1)"/>

    <div class="container-fluid" id="pcont">

        <div class="cl-mcont">
            <!--排行榜-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <h4>排行榜</h4>

                        </div>
                        <div class="content">

                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <!--申报地区排行-->
                                    <div class="block-flat">
                                        <div class="header">


                                            <h4>申报地区排行 Top10</h4>

                                        </div>


                                        <div class="content">
                                            <table class="no-border blue">
                                                <thead class="no-border">
                                                <tr>
                                                    <th>排行</th>
                                                    <th>区域</th>
                                                    <th>申报次数</th>
                                                    <th>申报数量</th>

                                                </tr>
                                                </thead>
                                                <tbody id="areatop" class="no-border-x">
                                                <tr>
                                                    <td>1</td>
                                                    <td>金山</td>
                                                    <td>800</td>
                                                    <td>3000</td>

                                                </tr>
                                                <tr>
                                                    <td>2</td>
                                                    <td>杨浦</td>
                                                    <td>800</td>
                                                    <td>2900</td>

                                                </tr>
                                                <tr>
                                                    <td>3</td>
                                                    <td>浦东</td>
                                                    <td>800</td>
                                                    <td>2600</td>

                                                </tr>
                                                <tr>
                                                    <td>4</td>
                                                    <td>崇明</td>
                                                    <td>800</td>
                                                    <td>2000</td>

                                                </tr>
                                                <tr>
                                                    <td>5</td>
                                                    <td>宝山</td>
                                                    <td>800</td>
                                                    <td>1000</td>

                                                </tr>
                                                </tbody>
                                            </table>

                                        </div>

                                    </div>


                                </div>

                                <div class="col-md-6 col-sm-6">
                                    <!--申报点排行-->
                                    <div class="block-flat">
                                        <div class="header">

                                            <h4>申报点排行 Top10</h4>

                                        </div>
                                        <div class="content">

                                            <table class="no-border blue">
                                                <thead class="no-border">
                                                <tr>
                                                    <th>排行</th>
                                                    <th>申报点名称</th>
                                                    <th>受理次数</th>
                                                    <th>受理数量</th>

                                                </tr>
                                                </thead>
                                                <tbody id="applytop" class="no-border-x">
                                                <tr>
                                                    <td>1</td>
                                                    <td>xxxx</td>
                                                    <td>800</td>
                                                    <td>3000</td>

                                                </tr>
                                                <tr>
                                                    <td>2</td>
                                                    <td>xxxx</td>
                                                    <td>800</td>
                                                    <td>3000</td>
                                                </tr>
                                                <tr>
                                                    <td>3</td>
                                                    <td>xxxx</td>
                                                    <td>800</td>
                                                    <td>3000</td>
                                                </tr>
                                                <tr>
                                                    <td>4</td>

                                                    <td>xxxx</td>
                                                    <td>800</td>
                                                    <td>3000</td>
                                                </tr>
                                                <tr>
                                                    <td>5</td>
                                                    <td>xxxx</td>
                                                    <td>800</td>
                                                    <td>3000</td>
                                                </tr>
                                                </tbody>
                                            </table>

                                        </div>

                                    </div>
                                </div>

                            </div>

                        </div>

                    </div>


                </div>
            </div>


            <!--产地检疫总体情况-->
            <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <div class="pull-right" style="width:85%">

                                <div class="row show-grid">
                                    <div class="col-md-2">
                                        <div class="btn-group">
                                            <button id="cdweek" type="button" class="btn btn-default">本周</button>
                                            <button id="cdmonth" type="button" class="btn btn-default">本月</button>
                                        </div>

                                    </div>
                                    <div class="col-md-3">
                                        <div class="input-daterange input-group">
                                            <input id="cdstart" type="text" class="input-sm form-control date datetime"
                                                   data-min-view="2" name="start" value="2017-07-01"
                                                   data-date-format="yyyy-mm-dd">
                                            <span class="input-group-addon">到</span>
                                            <input id="cdend" type="text" class="input-sm form-control date datetime"
                                                   data-min-view="2" name="end" value="2017-09-01"
                                                   data-date-format="yyyy-mm-dd">
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <select id="cdarea" class="select2" style="width: 150px">
                                            <option value="">所有区域</option>
                                            <optgroup th:each="cityarea:${areaList}"
                                                      th:label="${cityarea.city}">
                                                <option th:each="region:${cityarea.regions}"
                                                        th:text="${region}" th:value="${region}"></option>
                                            </optgroup>

                                        </select>

                                    </div>
                                    <div class="col-md-2">
                                        <select id="cdtype" class="form-control">
                                            <option value="0">所有畜种</option>

                                            <option value="1">猪</option>
                                            <option value="2">羊</option>
                                            <option value="3">牛</option>
                                            <option value="4">家禽</option>
                                        </select>
                                    </div>

                                    <div class="col-md-1">
                                        <button type="button" id="cdjysearch" class="btn btn-primary">
                                            搜索
                                        </button>
                                    </div>

                                </div>


                            </div>
                            <br/>
                            <h4>产地检疫总体情况</h4>

                        </div>
                        <div class="content">
                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <table class="no-border blue">
                                        <thead class="no-border">
                                        <tr>
                                            <th></th>

                                            <th></th>
                                            <th>同比</th>

                                            <th class="text-right">环比</th>
                                        </tr>
                                        </thead>
                                        <tbody class="no-border-x">
                                        <tr>
                                            <td>检疫申请数</td>
                                            <td id="jyshenqing">2000</td>
                                            <td><i id="jytbclass" class="fa fa-angle-up"></i><span id="jytb">30%</span>
                                            </td>

                                            <td id="jyhbtb" class="text-right color-danger"><i id="jyhbclass"
                                                                                               class="fa fa-angle-up"></i><span
                                                    id="jyhb">28%</span></td>
                                        </tr>
                                        <tr>
                                            <td>动物申报数量</td>
                                            <td id="dwshuliang">2000</td>
                                            <td><i id="dwtbclass" class="fa fa-angle-up"></i><span id="dwtb">30%</span>
                                            </td>

                                            <td id="dwhbtb" class="text-right color-danger"><i id="dwhbclass"
                                                                                               class="fa fa-angle-up"></i><span
                                                    id="dwhb">28%</span></td>
                                        </tr>
                                        <tr>
                                            <td>本地屠宰数量</td>
                                            <td id="bdtuzai">2000</td>
                                            <td><i id="bdtbclass" class="fa fa-angle-up"></i><span id="bdtb">30%</span>
                                            </td>

                                            <td id="bdhbtb" class="text-right color-danger"><i id="bdhbclass"
                                                                                               class="fa fa-angle-up"></i><span
                                                    id="bdhb">30%</span></td>
                                        </tr>
                                        <tr>
                                            <td>销往外市数量</td>
                                            <td id="wsshuliang">2000</td>
                                            <td><i id="wstbclass" class="fa fa-angle-up"></i><span id="wstb">30%</span>
                                            </td>

                                            <td id="wshbtb" class="text-right color-danger"><i id="wshbclass"
                                                                                               class="fa fa-angle-up"></i><span
                                                    id="wshb">30%</span></td>
                                        </tr>
                                        <tr>
                                            <td>合格数</td>
                                            <td id="qualified">2000</td>
                                            <td><i id="hgtbclass" class="fa fa-angle-up"></i><span id="qutb">30%</span>
                                            </td>

                                            <td id="hghbtb" class="text-right color-danger"><i id="hghbclass"
                                                                                               class="fa fa-angle-up"></i><span
                                                    id="quhb">28%</span></td>
                                        </tr>
                                        <tr>
                                            <td>不合格数</td>
                                            <td id="unqualified">2000</td>
                                            <td><i id="bhgtbclass" class="fa fa-angle-up"></i><span id="untb">30%</span>
                                            </td>

                                            <td id="bhghbtb" class="text-right color-danger"><i id="bhghbclass"
                                                                                                class="fa fa-angle-up"></i><span
                                                    id="unhb">28%</span></td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-6 col-sm-6">
                                    <div id="quxiangChart" style="width: 500px;height:200px;"></div>
                                </div>


                            </div>

                        </div>


                    </div>
                </div>

            </div>
            <!--产地检疫总体情况end-->
            <!--本地屠宰场-->
       <!--     <div class="row">
                <div class="col-md-12">
                    <div class="block-flat">
                        <div class="header">
                            <div class="pull-right" style="width:80%">

                                <div class="row show-grid">
                                    <div class="col-md-2">
                                        <div class="btn-group">
                                            <button id="bdweek" type="button" class="btn btn-default">本周</button>
                                            <button id="bdmonth" type="button" class="btn btn-default">本月</button>
                                        </div>

                                    </div>
                                    <div class="col-md-3">
                                        <div class="input-daterange input-group" id="datepicker">
                                            <input type="text" id="bdstart" class="input-sm form-control date datetime"
                                                   data-min-view="2" name="start" value="2017-8-10"
                                                   data-date-format="yyyy-mm-dd">
                                            <span class="input-group-addon">到</span>
                                            <input type="text" id="bdend" class="input-sm form-control date datetime"
                                                   data-min-view="2" name="end" value="2017-7-26"
                                                   data-date-format="yyyy-mm-dd">
                                        </div>
                                    </div>
                                    <div class="col-sm-2">
                                        <select id="bdarea" class="select2" style="width: 150px">
                                            <option value="">所有区域</option>
                                            <optgroup th:each="cityarea:${areaList}"
                                                      th:label="${cityarea.city}">
                                                <option th:each="region:${cityarea.regions}"
                                                        th:text="${region}" th:value="${region}"></option>
                                            </optgroup>

                                        </select>

                                    </div>

                                    <div class="col-md-2">
                                        <select id="bdtype" class="form-control">
                                            <option value="0">所有畜种</option>

                                            <option value="1">猪</option>
                                            <option value="2">羊</option>
                                            <option value="3">牛</option>
                                            <option value="4">家禽</option>
                                        </select>
                                    </div>

                                    <div class="col-md-1">
                                        <button type="button" id="bdsearch" class="btn btn-primary">搜索</button>
                                    </div>

                                </div>


                            </div>
                            <br/>
                            <h4>去往本地屠宰场分布图</h4>

                        </div>
                        <div class="content">
                            <div class="row">

                                <div class="col-md-6 col-sm-6">
                                    <table class="no-border blue">
                                        <thead class="no-border">
                                        <tr>
                                            <th>排行</th>
                                            <th>屠宰场名称</th>

                                            <th>数量</th>
                                            <th>占比</th>
                                            <th>同比</th>

                                            <th class="text-right">环比</th>
                                        </tr>
                                        </thead>
                                        <tbody id="bdimag" class="no-border-x">
                                        <tr>
                                            <td>1</td>
                                            <td>焕山屠宰场</td>
                                            <td>2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>
                                        <tr>
                                            <td>2</td>
                                            <td>焕山屠宰场</td>
                                            <td>2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>
                                        <tr>
                                            <td>3</td>
                                            <td>焕山屠宰场</td>
                                            <td>2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>
                                        <tr>
                                            <td>4</td>
                                            <td>焕山屠宰场</td>
                                            <td>2000</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>
                                            <td><i class="fa fa-angle-up"></i>30%</td>

                                            <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                <div class="col-md-6 col-sm-6">
                                    <div id="tuzaiChart" style="width: 500px;height:200px;"></div>
                                </div>


                            </div>

                        </div>


                    </div>
                </div>

                &lt;!&ndash;本地屠宰场end&ndash;&gt;
            </div>-->
        </div>
    </div>

</div>

<script type="text/javascript" src="/webjars/js/jquery.js"></script>


<script type="text/javascript" src="/webjars/js/jquery.nanoscroller/jquery.nanoscroller.js"></script>
<script type="text/javascript" src="/webjars/js/behaviour/general.js"></script>
<script src="/webjars/js/jquery.ui/jquery-ui.js" type="text/javascript"></script>

<script type="text/javascript" src="/webjars/js/jquery.nestable/jquery.nestable.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.switch/bootstrap-switch.min.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="//cdn.bootcss.com/select2/3.4.5/select2.min.js" type="text/javascript"></script>

<script src="/webjars/js/bootstrap.slider/js/bootstrap-slider.js" type="text/javascript"></script>
<script type="text/javascript" src="/webjars/js/jquery.niftymodals/js/jquery.modalEffects.js"></script>
<script type="text/javascript" src="/webjars/js/bootstrap.summernote/dist/summernote.min.js"></script>

<script type="text/javascript" src="/webjars/js/jquery.magnific-popup/dist/jquery.magnific-popup.min.js"></script>


<script src="/webjars/js/behaviour/voice-commands.js"></script>
<script src="/webjars/js/bootstrap/dist/js/bootstrap.min.js"></script>

<script src="//cdn.bootcss.com/echarts/3.6.2/echarts.min.js"></script>
<script type="text/javascript">
    function color(num) {
        if (num > 0) {
            return "text-right color-success"
        }
        if (num == 0) {
            return "text-right color-primary"
        }
        if (num < 0) {
            return "text-right color-danger"
        }
    }

    function jt(num) {
        if (num > 0) {
            return "fa fa-angle-up"
        }
        if (num == 0) {
            return "fa fa-angle-right"
        }
        if (num < 0) {
            return "fa fa-angle-down"
        }
    }
    $(document).ready(function () {



        App.init();


        $.ajax({
            type: "GET",
            url: "/djt/quarantine/areaorder",
            dataType: "json",
            success: function (data) {
                var areatop = "";
                $.each(data, function (index, item) {
                    var num = index + 1;
                    areatop += "<tr><td>" + num + "</td>" +
                        "<td>" + item.street + "</td>" +
                        "<td>" + item.ranking + "</td>" +
                        "<td>" + item.num + "</td></tr>"
                })
                $("#areatop").text("");
                $("#areatop").append(areatop);
            }
        });
        $.ajax({
            type: "GET",
            url: "/djt/quarantine/applyorder",
            dataType: "json",
            success: function (data) {
                var applytop = "";
                $.each(data, function (index, item) {
                    var num = index + 1;
                    applytop += "<tr><td>" + num + "</td>" +
                        "<td>" + item.town + "</td>" +
                        "<td>" + item.ranking + "</td>" +
                        "<td>" + item.num + "</td></tr>"
                })
                $("#applytop").text("");
                $("#applytop").append(applytop);
            }
        });

        $.ajax({
            type: "GET",
            url: "/djt/quarantine/applyorder",
            dataType: "json",
            success: function (data) {
                var applytop = "";
                /* <tr>
                 <td>1</td>
                 <td>xxxx</td>
                 <td>800</td>
                 <td>3000</td>
                 </tr>*/
                $.each(data, function (index, item) {
                    var num = index + 1;
                    applytop += "<tr><td>" + num + "</td>" +
                        "<td>" + item.town + "</td>" +
                        "<td>" + item.ranking + "</td>" +
                        "<td>" + item.num + "</td></tr>"
                })
                $("#applytop").text("");
                $("#applytop").append(applytop);
            }
        });
        function numzb(num1, num2) {
            if (num2 == 0) {
                return 0;
            }
            var i = Number(num1);
            var m = Number(num2);
            var result = i / m;
            return Math.round(result*100);
        }

        //--------------去向本地屠宰变化---------------------------

       /* bdtz = function (time1) {
            if (time1 == null || time1 == "") {
                if ($("#bdstart").val() != null && $("#bdstart").val() != "") {
                    time1 = $("#bdstart").val();
                } else {
                    if (now.getMonth() > 10) {
                        time1 = formatDate(new Date(now.getFullYear() + 1, 0, now.getDate() - now.getDay()));
                    } else {
                        time1 = formatDate(new Date(now.getFullYear(), now.getMonth() + 1, now.getDate() - now.getDay()));
                    }
                }
            }

            var datas = {
                'start': new Date(time1),
                'end': $("#bdend").val() == "" ? new Date() : new Date($("#bdend").val()),
                'area': $("#bdarea").val(),
                'type': $("#bdtype").val()
            }

            $.ajax({
                type: "GET",
                url: "/djt/quarantine/localbutcher",
                data: datas,
                dataType: "json",
                success: function (data) {
                    /!* <tr>
                     <td>1</td>
                     <td>焕山屠宰场</td>
                     <td>2000</td>
                     <td><i class="fa fa-angle-up"></i>30%</td>
                     <td><i class="fa fa-angle-up"></i>30%</td>

                     <td class="text-right color-danger"><i class="fa fa-angle-up"></i>28%</td>
                     </tr>*!/
                    var bdimag = "";
                    var bdname = "";
                    var bddata = "";
                    var list = new Array;
                    $.each(data, function (index, item) {
                        var num = index + 1;
                        bdimag += "<tr>" +
                            "<td>" + num + "</td>" +
                            "<td>" + item.name + "</td>" +
                            "<td>" + item.num + "</td>" +
                            "<td>" + numzb(num, item.allnum) + "%" + "</td>" +
                            "<td><i class='" + jt(item.numt) + "'></i>" + item.numt + "%" + "</td>" +
                            "<td class='" + color(item.numh) + "'><i class='" + jt(item.numh) + "'></i>" + item.numh + "%" + "</td>";
                        list[index] = item.name;
                        bddata += "{\"value\":\"" + item.num + "\",\"name\":\"" + item.name + "\"}";
                        if (num < data.size) {
                            bdname += ",";
                            bddata += ",";
                        }

                    })
                    /!* bdname += "]";*!/
                    $("#bdimag").html("");
                    $("#bdimag").append(bdimag);
                    if (bdname != "") {
                        bdname = JSON.parse(bdname);
                    }
                    if (bddata != "") {
                        bddata = JSON.parse(bddata);
                    }
                    var tuzaiChart = echarts.init(document.getElementById('tuzaiChart'));
                    option = {

                        tooltip: {
                            trigger: 'item',
                            formatter: "{a} <br/>{b} : {c} ({d}%)"
                        },
                        legend: {
                            orient: 'vertical',
                            left: 'right',
                            data: list
                        },
                        series: [
                            {
                                name: '访问来源',
                                type: 'pie',
                                radius: '55%',
                                center: ['50%', '60%'],
                                data: [bddata],
                                itemStyle: {
                                    emphasis: {
                                        shadowBlur: 10,
                                        shadowOffsetX: 0,
                                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                                    }
                                }
                            }
                        ]
                    };
                    tuzaiChart.setOption(option);
                }

            })
        }
*/

        //--------------去向分布变化---------------------------
        cdjy = function (time1) {
            if (time1 == null || time1 == "") {
                if ($("#cdstart").val() != null && $("#cdstart").val() != "") {
                    time1 = $("#cdstart").val();
                } else {
                    if (now.getMonth() > 10) {
                        time1 = formatDate(new Date(now.getFullYear() + 1, 0, now.getDate() - now.getDay()));
                    } else {
                        time1 = formatDate(new Date(now.getFullYear(), now.getMonth() + 1, now.getDate() - now.getDay()));
                    }
                }
            }

            var datas = {
                'start': new Date(time1),
                'end': $("#cdend").val() == "" ? new Date() : new Date($("#cdend").val()),
                'area': $("#cdarea").val(),
                'type': $("#cdtype").val()
            }
            $.ajax({
                type: "GET",
                url: "/djt/quarantine/cdjy",
                data: datas,
                dataType: "json",
                success: function (data) {
                    $.each(data, function (index, item) {
                        $("#jyshenqing").text(item.ranking);
                        $("#dwshuliang").text(item.num);
                        $("#qualified").text(item.qualified);
                        $("#unqualified").text(item.unqualified);
                        $("#bdtuzai").text(item.islocal);
                        $("#wsshuliang").text(item.notlocal);
                        $("#jytb").text(item.rankingt + "%");
                        $("#dwtb").text(item.numt + "%");
                        $("#bdtb").text(item.islocalt + "%");
                        $("#wstb").text(item.notlocalt + "%");
                        $("#qutb").text(item.qualifiedt + "%");
                        $("#untb").text(item.unqualifiedt + "%");
                        $("#jyhb").text(item.rankingh + "%");
                        $("#dwhb").text(item.numh + "%");
                        $("#bdhb").text(item.islocalh + "%");
                        $("#wshb").text(item.notlocalh + "%");
                        $("#quhb").text(item.qualifiedh + "%");
                        $("#unhb").text(item.unqualifiedh + "%");

                        $("#jytbclass").attr("class", jt(item.rankingt));
                        $("#jyhbclass").attr("class", jt(item.rankingh));
                        $("#dwtbclass").attr("class", jt(item.numt));
                        $("#dwhbclass").attr("class", jt(item.numh));
                        $("#bdtbclass").attr("class", jt(item.islocalt));
                        $("#bdhbclass").attr("class", jt(item.islocalh));
                        $("#wstbclass").attr("class", jt(item.notlocalt));
                        $("#wshbclass").attr("class", jt(item.notlocalh));
                        $("#hgtbclass").attr("class", jt(item.qualifiedt));
                        $("#hghbclass").attr("class", jt(item.qualifiedh));
                        $("#bhgtbclass").attr("class", jt(item.unqualifiedt));
                        $("#bhghbclass").attr("class", jt(item.unqualifiedh));

                        $("#jyhbtb").attr("class", color(item.rankingh));
                        $("#dwhbtb").attr("class", color(item.numh));
                        $("#bdhbtb").attr("class", color(item.islocalh));
                        $("#wshbtb").attr("class", color(item.notlocalh));
                        $("#hghbtb").attr("class", color(item.qualifiedh));
                        $("#bhghbtb").attr("class", color(item.unqualifiedh));


                        var quxiangChart = echarts.init(document.getElementById('quxiangChart'));

                        option = {
                            tooltip: {
                                trigger: 'item',
                                formatter: "{a} <br/>{b}: {c} ({d}%)"
                            },
                            legend: {
                                orient: 'vertical',
                                x: 'left',
                                data: ['本地屠宰', '销往外地']
                            },
                            series: [
                                {
                                    name: '数量',
                                    type: 'pie',
                                    radius: ['50%', '70%'],
                                    avoidLabelOverlap: false,
                                    label: {
                                        normal: {
                                            show: false,
                                            position: 'center'
                                        },
                                        emphasis: {
                                            show: true,
                                            textStyle: {
                                                fontSize: '24',
                                                fontWeight: 'bold'
                                            }
                                        }
                                    },
                                    labelLine: {
                                        normal: {
                                            show: false
                                        }
                                    },
                                    data: [
                                        {value: item.islocal, name: '本地屠宰'},
                                        {value: item.num - item.islocal, name: '销往外地'}
                                    ]
                                }
                            ]
                        };
                        quxiangChart.setOption(option);
                    })
                }

            })
        }
    });
</script>

<script type="text/javascript">
    //排行
    $(function () {
        //格式化日期：yyyy-MM-dd
        function formatDate(date) {
            var myyear = date.getFullYear();
            var mymonth = date.getMonth() + 1;
            var myweekday = date.getDate();

            if (mymonth < 10) {
                mymonth = "0" + mymonth;
            }
            if (myweekday < 10) {
                myweekday = "0" + myweekday;
            }
            return (myyear + "-" + mymonth + "-" + myweekday);
        }



        (function () {
            var date = new Date();

            var end = formatDate(date);
            var start = formatDate(new Date(date.getTime()-1000*3600*24*7));

            $("#cdstart").val(start);
            $("#cdend").val(end);
            /*$("#bdstart").val(start);
            $("#bdend").val(end);*/

            cdjy(null);
    /*        bdtz(null);*/
            $("#cdjysearch").click(function () {
                cdjy(null);
            });

            $("#cdweek").click(function () {
                var now = new Date()
                var time1 = formatDate(new Date(now.getFullYear(), now.getMonth(), now.getDate() - now.getDay()));
                cdjy(new Date(time1));
            })
            $("#cdmonth").click(function () {
                var now = new Date()
                var time1 = formatDate(new Date(now.getFullYear(), now.getMonth(), 1));
                cdjy(new Date(time1));
            })
           /* $("#bdsearch").click(function () {
                bdtz(null, null);
            });

            $("#bdweek").click(function () {
                var now = new Date()
                var time1 = formatDate(new Date(now.getFullYear(), now.getMonth(), now.getDate() - now.getDay()));

                bdtz(new Date(time1));
            })
            $("#bdmonth").click(function () {
                var now = new Date()
                var time1 = formatDate(new Date(now.getFullYear(), now.getMonth(), 1));

                bdtz(new Date(time1));
            })*/

        })()


    })

</script>

</body>
</html>
